package com.jcl.recruit.apply.mapper;

import com.jcl.recruit.apply.model.Interview;

import static org.apache.ibatis.jdbc.SqlBuilder.*;


public class InterviewSqlProvider {

    public String insertSelective(Interview record) {
        BEGIN();
        INSERT_INTO("interview");
        
        if (record.getResumeId() != null) {
            VALUES("resume_id", "#{resumeId,jdbcType=INTEGER}");
        }
        
        if (record.getJobId() != null) {
            VALUES("job_id", "#{jobId,jdbcType=INTEGER}");
        }
        
        if (record.getJob() != null) {
            VALUES("job", "#{job,jdbcType=VARCHAR}");
        }
        
        if (record.getHrIds() != null) {
            VALUES("hr_ids", "#{hrIds,jdbcType=VARCHAR}");
        }
        
        if (record.getStep() != null) {
            VALUES("step", "#{step,jdbcType=INTEGER}");
        }
        
        if (record.getSkdnums() != null) {
            VALUES("skdnums", "#{skdnums,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdTime() != null) {
            VALUES("last_skd_time", "#{lastSkdTime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getLastSkdResult() != null) {
            VALUES("last_skd_result", "#{lastSkdResult,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdDepartment() != null) {
            VALUES("last_skd_department", "#{lastSkdDepartment,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdDepartmentId() != null) {
            VALUES("last_skd_department_id", "#{lastSkdDepartmentId,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdManagerId() != null) {
            VALUES("last_skd_manager_id", "#{lastSkdManagerId,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdManager() != null) {
            VALUES("last_skd_manager", "#{lastSkdManager,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdHrId() != null) {
            VALUES("last_skd_hr_id", "#{lastSkdHrId,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdHr() != null) {
            VALUES("last_skd_hr", "#{lastSkdHr,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdPlace() != null) {
            VALUES("last_skd_place", "#{lastSkdPlace,jdbcType=VARCHAR}");
        }
        
        if (record.getStatus() != null) {
            VALUES("status", "#{status,jdbcType=INTEGER}");
        }
        
        if (record.getCreatetime() != null) {
            VALUES("createtime", "#{createtime,jdbcType=TIMESTAMP}");
        }
        
        return SQL();
    }

    public String updateByPrimaryKeySelective(Interview record) {
        BEGIN();
        UPDATE("interview");
        
        if (record.getResumeId() != null) {
            SET("resume_id = #{resumeId,jdbcType=INTEGER}");
        }
        
        if (record.getJobId() != null) {
            SET("job_id = #{jobId,jdbcType=INTEGER}");
        }
        
        if (record.getJob() != null) {
            SET("job = #{job,jdbcType=VARCHAR}");
        }
        
        if (record.getHrIds() != null) {
            SET("hr_ids = #{hrIds,jdbcType=VARCHAR}");
        }
        
        if (record.getStep() != null) {
            SET("step = #{step,jdbcType=INTEGER}");
        }
        
        if (record.getSkdnums() != null) {
            SET("skdnums = #{skdnums,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdTime() != null) {
            SET("last_skd_time = #{lastSkdTime,jdbcType=TIMESTAMP}");
        }
        
        if (record.getLastSkdResult() != null) {
            SET("last_skd_result = #{lastSkdResult,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdDepartment() != null) {
            SET("last_skd_department = #{lastSkdDepartment,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdDepartmentId() != null) {
            SET("last_skd_department_id = #{lastSkdDepartmentId,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdManagerId() != null) {
            SET("last_skd_manager_id = #{lastSkdManagerId,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdManager() != null) {
            SET("last_skd_manager = #{lastSkdManager,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdHrId() != null) {
            SET("last_skd_hr_id = #{lastSkdHrId,jdbcType=INTEGER}");
        }
        
        if (record.getLastSkdHr() != null) {
            SET("last_skd_hr = #{lastSkdHr,jdbcType=VARCHAR}");
        }
        
        if (record.getLastSkdPlace() != null) {
            SET("last_skd_place = #{lastSkdPlace,jdbcType=VARCHAR}");
        }
        
        if (record.getStatus() != null) {
            SET("status = #{status,jdbcType=INTEGER}");
        }
        
        if (record.getCreatetime() != null) {
            SET("createtime = #{createtime,jdbcType=TIMESTAMP}");
        }
        
        WHERE("id = #{id,jdbcType=INTEGER}");
        
        return SQL();
    }
}